package com.compty.paint.domain;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.compty.security.domain.User;

/**
 * @Todo:推广信息
 * @author: 朱庆辉
 * @CreateTime:2012-4-16 上午12:35:01
 */
@Entity
@Table(name = "t_promotion")
public class PromotionDetail {
	
	private Integer id;
	
	private Date createTime;//推广时间
	
	private String fetchType;//推广方式
	
	private Integer goods_id;
	
	private Long bid_id;
	
	private Bid bid;
	
	private User user;//推广人

	
	@Id
	@GeneratedValue
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "create_time")
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Column(name = "fetch_type",length=10)
	public String getFetchType() {
		return fetchType;
	}

	public void setFetchType(String fetchType) {
		this.fetchType = fetchType;
	}

	@Column(name = "goods_id")
	public Integer getGoods_id() {
		return goods_id;
	}

	public void setGoods_id(Integer goodsId) {
		goods_id = goodsId;
	}

	@Column(name = "bid_id")
	public Long getBid_id() {
		return bid_id;
	}

	public void setBid_id(Long bidId) {
		bid_id = bidId;
	}

	@Transient
	public Bid getBid() {
		return bid;
	}

	public void setBid(Bid bid) {
		this.bid = bid;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name="userinfo_id")
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}
}
